﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Hydra.Shell.Interfaces;

namespace Hydra.Shell.Implementations
{
    public class CommonException : Exception, IUnknown
    {
        public int ExceptionCode { get; private set; }
        public EventHandler Disposed { get; set; }
        private bool isDisposed;

        public CommonException(int exceptionCode)
        {
            this.ExceptionCode = exceptionCode;
        }

        ~CommonException()
        {
            isDisposed = true;

            if (Disposed != null)
            {
                Disposed(this, EventArgs.Empty);
            }
        }

        public bool IsDisposed
        {
            get 
            {
                return isDisposed;
            }
        }

        public bool QueryInterface(Guid iid, out IUnknown interfaceObject)
        {
            interfaceObject = null;
            return false;
        }

        public bool QueryInterface<T>(out T interfaceObject)
        {
            interfaceObject = default(T);
            return false;
        }
    }
}
